package cn.wit.front.controller;

import cn.wit.front.condition.ContestHistoryInfoCondition;
import cn.wit.front.service.ContestHistoryInfoService;
import cn.wit.utils.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/contest")
@CrossOrigin
@Api(tags = "竞赛浏览记录")
public class ContestHistoryInfoController {
    private Logger logger = LoggerFactory.getLogger(ContestHistoryInfoController.class);
    @Autowired
    private ContestHistoryInfoService contestHistoryInfoService;

    @PostMapping("/insertContestHistoryInfo")
    @ApiOperation("竞赛信息历史记录新增")
    public Result insertContestHistoryInfo(@RequestBody ContestHistoryInfoCondition condition) {
        return this.contestHistoryInfoService.insertContestHistoryInfo(condition);
    }

    @PostMapping("/recommandContest")
    @ApiOperation("保研推荐")
    public Result recommandContest(String username) {
        return contestHistoryInfoService.recommandContest(username);
    }

}
